What makes Happiness?#

Context#

For a long time, people have been interested in what makes us happy and how we can improve well-being in society. One big question is whether having more money or wealth actually makes people happier, or if there are other things that matter more. We often hear the saying “money can’t buy happiness,” but the real answer is a bit more complicated than that.

In this data story, we will explore how happiness relates to different economic and social factors using information from the World Happiness Report 2019 and World Development Indicators. This report looks at how happy people are in different countries and compares that with demographic variables like GDP per capita, Gross National Income (GNI), the gini index, unemployment rates, education levels, and life expectancy.

We want to find out if richer countries really have happier people, and if so, how strong this connection is. But we will also look beyond money to see how things like having a job, going to school, and living a long, healthy life affect happiness.

First, we will compare happiness scores with our economic variables: GDP per capita, GNI per capita and the gini index. Then, we will analyze how our socioeconomoical variables: unemployment rates, life expectancy and education expenditure relate to happiness.

By comparing these different aspects, we hope to better understand what really contributes to happiness around the world. This will help us see whether the saying “money buys happiness” really holds. And if it doesn’t hold, we could find out what factors do contribute to happiness.

To start off, we’ll illustrate world happiness around the globe by visualizing world happiness with a heatmap as can be seen below.

Money comes from economic prosperity#

Correlation#

To explore how national wealth relates to well-being, we analyzed happiness in relation to three key economic indicators: GDP per capita, GNI per capita, and the Gini Index (income inequality).

For this analysis we created three scatter plots. Through the slider the user can interactively switch between them. They show all data points, comparing the respective variable to happiness. Afterwards a trendline is added to illutstrate the overall correlation.

The graphs show a strong positive correlation between both GDP per capita and GNI per capita and happiness. Countries with higher values on these indicators tend to report higher happiness scores, supporting the idea that wealth improves access to basic needs and services, contributing to well-being. However, the relationship isn’t perfect—some wealthy countries still show only moderate happiness, suggesting that money alone doesn’t guarantee life satisfaction.

In contrast, the Gini Index shows a slight negative correlation: as income inequality increases, happiness tends to decrease. This implies that how wealth is distributed matters. Even in wealthy nations, greater inequality may reduce overall happiness, possibly by influencing perceptions of fairness or social mobility.

Overall, the data suggests that while money does matter, its distribution and other non-economic factors likely play an important role as well.

Mismatch#

To further support our findings, we examined the mismatch between each economic variable and happiness rankings. For each country, we ranked its position based on both happiness and the respective variable, then visualized the differences using a slope graph. Lines connecting the two rankings are colored:

  • Red if the difference exceeds a defined mismatch threshold

  • Blue if the difference is within that threshold

This visual approach helps identify how well a variable aligns with happiness across countries. It not only highlights overall correlation but also brings attention to extreme outliers where the variable and happiness diverge significantly.

Below, the slope graph shows the mismatch between happiness rankings and rankings for Gini Index, GDP per capita, and GNI per capita. In the top-right corner, the total number of mismatched countries is displayed.

As shown, Gini Index exhibits a high mismatch, indicating that its link to happiness is weaker and more inconsistent. In contrast, both GDP per capita and GNI per capita show a low mismatch, reinforcing their strong correlation with happiness. The mismatch threshold was set to 20 for Gini Index (due to limited data) and 30 for GDP/GNI per capita.

These results further strengthen our earlier conclusion: wealth indicators like GDP and GNI per capita align closely with happiness, while income inequality (Gini Index) has only a mild and less reliable connection.

Happiness comes from socioeconomic prosperity#

Correlation#

While economic wealth can account for part of the variation in national happiness, other societal factors may offer additional insights. In this section, we explore the relationship between happiness and three key socioeconomic variables: life expectancy, unemployment rate, and education expenditure.

This is done in the same way as the economic variables: through an interactive scatter plot. Feel free to use the slider to switch between variables.

The first plot, Happiness vs Life Expectancy, shows a clear positive trend. Countries where people live longer tend to report higher happiness levels. This suggests that longer life expectancy is closely associated with national well-being.

In contrast, Happiness vs Unemployment Rate reveals a slight negative correlation. Countries with higher unemployment rates generally show lower happiness scores. This supports findings from previous studies, such as Winkelmann (2014), which highlight the negative impact of job insecurity and economic instability on people’s life satisfaction.

Lastly, Happiness vs Education Expenditure shows a mild positive relationship. Countries that invest more of their GDP into education tend to report higher happiness levels. While the trend is weaker, it suggests that access to quality education contributes to a happier and more informed population.

Together, these plots show that socioeconomic indicators, especially life expectancy, can offer valuable insights into national happiness beyond economic wealth alone.

Mismatch#

Just like with the economic variables, a slope graph is used here to show the mismatch between happiness rankings and the rankings of three socioeconomic variables: life expectancy, unemployment rate, and education expenditure. The same rules as before apply; countries with a ranking difference above the threshold of 30 are highlighted in red.

The graph gives further insight into how well each variable aligns with happiness across countries. Life expectancy shows the lowest mismatch of the three, though still notably higher than GDP or GNI per capita. This could indicate either:

  • That life expectancy has a weaker correlation with happiness than GDP/GNI per capita, or

  • That life expectancy varies more across countries, with more outliers skewing the results.

Both possibilities provide valuable context in understanding how health and longevity relate to happiness.

In contrast, unemployment rate and education expenditure show relatively high mismatches. This supports our earlier observation that these variables exhibit only mild correlations with happiness. This highlights that while they may contribute to well-being, their influence is less consistent across countries.

Pearson correlation coefficient#

To concretely analyze the correlation between happiness and all our variables, Gini Index, GDP per capita, GNI per capita, life expectancy, unemployment rate, and education expenditure, we created a correlation matrix. Each cell shows the Pearson correlation coefficient, calculated as follows:
\(r = \frac{\sum (x_i - \bar{x})(y_i - \bar{y})}{\sqrt{\sum (x_i - \bar{x})^2 \sum (y_i - \bar{y})^2}}\)
In this formula, x is the variable while y is the happiness score.

The further the number deviates from 0, the more correlation there is between happiness and the respective variable. A positive number indicates a positive correlation (if x increases, y increases). A negative number indicates a negative correlation (if x increases, y decreases).

As shown in the matrix, we observe a strong positive correlation between happiness and GDP per capita, GNI per capita, and life expectancy. This also helps explain the slightly higher mismatch we saw for life expectancy earlier: its correlation with happiness is strong, but the variable likely contains more outliers or variation than GDP/GNI per capita.

On the other hand, education expenditure, unemployment rate, and Gini Index show noticeably weaker correlations. This supports our earlier findings, where these variables had flatter trendlines. Furthermore, the negative correlation for unemployment rate and Gini Index aligns well with our previous analysis where our trendlines were going downhill.

Overall, the correlation matrix gives a concise and accurate summary of the relationships we’ve observed throughout our scatter plots and mismatch graphs.

The weight of economic and socioeconomic variables#

In this section, we explore how much each variable contributes to the happiness score using what we call a “tug-of-war” visualization. The larger a block, the greater the variable’s impact on happiness. These contributions are grouped into two boxes, representing the overall influence of economic and socioeconomic variables.

As shown in the graph, the economic variables outweigh the socioeconomic ones by 10.8%. This suggests that economic factors do play a larger role in determining a country’s average happiness. That said, socioeconomic factors still account for 44.6% of the total, highlighting their significant influence as well.

Of course, this graph doesn’t capture everything. There are many more economic and socioeconomic factors not included here, and the analysis does not account for interconnected correlations between variables. So, within the scope of this project, it’s not possible to definitively state whether economic or socioeconomic factors have a greater overall impact.

What we can conclude is that both types of variables matter. Economic factors like GDP per capita and GNI per capita, and socioeconomic indicators like life expectancy, clearly do play important roles in shaping national happiness.